<?php

class ServicesPage {

	function __construct($ServicesPageID, $ServicesPageHTML, $timestamp) {
			$this->ServicesPageID = $ServicesPageID;
			$this->ServicesPageHTML = $ServicesPageHTML;
			$this->timestamp = $timestamp;
		}
		
	var $ServicesPageID;
	function get_ServicesPageID () { return $this->ServicesPageID; }
	
	var $ServicesPageHTML;
	function get_ServicesPageHTML () { return $this->ServicesPageHTML; }
	
	var $timestamp;
	function get_timestamp () { return $this->timestamp; }
	
	function get_mostRecentServicesPage()
	{
		include(dirname(__FILE__) . "/../Database.inc");
		
		$link = ConnectToDatabase2();
		$sql = "SELECT `body`, `insert_tstamp`, `id` from `services` where `insert_tstamp` IN (SELECT MAX(`insert_tstamp`) FROM `services`)";
		$result = RunSql($sql, $link);

		$row = mysql_fetch_assoc($result);

	    $this->ServicesPageID = $row['id'];
		$this->ServicesPageHTML = html_entity_decode(stripslashes($row['body']));

		$this->timestamp = $row['insert_tstamp'];
	}
}
?>